package com.bruce.demo.sequence.controller;

import com.bruce.demo.sequence.client.SequenceClientService;
import com.bruce.demo.sequence.service.SequenceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author luotuan
 * @Description
 * @create 2020-05-15 21:14
 **/
@RestController
@RequestMapping("/sequence")
public class SequenceController {
    @Autowired
    private SequenceService sequenceService;
    @Autowired
    private SequenceClientService clientService;
    @RequestMapping("/get")
    public String getSequence(String sysCode,String code){
        String gid = String.valueOf(sequenceService.getSequence(sysCode,code));
        return gid;
    }

    @RequestMapping("/get2")
    public String getSequence2(String sysCode,String code){
        String gid = String.valueOf(clientService.getSequence(sysCode,code));
        return gid;
    }
}
